<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="s" uri="http://www.springframework.org/tags" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ taglib uri="oastaglib" prefix="oas" %>
<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>Insert title here</title>

    <link rel="stylesheet" type="text/css" href="<c:url value="/resources/bootstrap/dist/css/bootstrap.min.css" /> ">
    <script type="text/javascript" src="<c:url value="/resources/js/jquery/dist/jquery.min.js"/>"></script>
    <script type="text/javascript" src="<c:url value="/resources/bootstrap/dist/js/bootstrap.min.js"/>"></script>
</head>
<body>
<oas:nav/>

<oas:content>

    <div>
            <%-- <a href="<c:url value="/" />">返回首页</a> --%>
        <h1>已通过审核请假</h1>
        <a href="<c:url value="/manager/leave"/> ">返回</a>
        <c:forEach items="${paginationSupportChecked.items}" var="leave">
            <div class="card">
                <div class="card-header">
                    请假人：
                    <c:out value="${leave.applicant.fullName }"/>
                </div>
                <div class="card-body">
                    请假类型:
                    <c:out value="${leave.type.description}"/>
                    <br/>
                    该员工所属部门:
                    <c:out value="${leave.applicant.workcell.name}"/>
                    <br/>
                    <div>
                        <a href="<c:url value="/manager/leave/leaveChecked/${leave.id}" />">查看详情</a>
                    </div>
                </div>
                <div class="card-footer">
                    请假时间:
                    <fmt:formatDate value="${leave.applyDate}"
                                    pattern="yyyy-MM-dd HH:mm:ss"/>
                </div>
            </div>

            <br>
        </c:forEach>

    </div>
    <div>
        每页${paginationSupportChecked.pageSize}条待审核请假，
        第${paginationSupportChecked.currentPageNo}/${paginationSupportChecked.totalPageCount}页,共${paginationSupportChecked.totalCount}条请假
        <ul class="pagination">
            <c:if test="${paginationSupportChecked.previousPage}">
                <li class="page-item">
                    <a class="page-link"
                       href="<c:url value="/manager/leave/leaveChecked?pageNo=${paginationSupportChecked.currentPageNo-1}" />">上一页</a>
                </li>
            </c:if>
            <c:forEach var="i" begin="1" end="${paginationSupportChecked.totalPageCount}" step="1">
                <li class="page-item">
                    <a class="page-link"
                       href="<c:url value="/manager/leave/leaveChecked?pageNo=${i}" />"> ${i}</a>
                </li>
            </c:forEach>
            <c:if test="${paginationSupportChecked.nextPage}">
                <li class="page-item">
                    <a class="page-link"
                       href="<c:url value="/manager/leave/leaveChecked?pageNo=${paginationSupportChecked.currentPageNo+1}" />">下一页 </a>
                </li>
            </c:if>
        </ul>
    </div>
</oas:content>
<oas:footer/>
</body>
</html>